refactor(clippy): collapse if and drop redundant closure in compile/mod.rs#687
Merged
jamesadevine merged 1 commit intoMay 22, 2026
Conversation
…od.rs
Fix two clippy lints in src/compile/mod.rs:
- collapsible_if at line 269: merge nested `if sync_gitattributes { if let Err` into a single `if … && let` chain
- redundant_closure at line 493: replace `|line| parse_header_line(line)` with `parse_header_line` directly
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open
jamesadevine
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What clippy found
How it was fixed
clippy::collapsible_if(line 269): merged the nestedif sync_gitattributes { if let Err(e) = ... }into a singleif sync_gitattributes && let Err(e) = ...chain (valid in Rust 2024 edition).clippy::redundant_closure(line 493): replaced|line| crate::detect::parse_header_line(line)withcrate::detect::parse_header_linedirectly.Only
src/compile/mod.rswas touched.Verification
cargo build --all-targets✅cargo test✅ (all tests pass)cargo clippy --all-targets --all-features --workspace -- -D warnings✅ (no warnings in compile/mod.rs)Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
dev.azure.comSee Network Configuration for more information.